﻿using System;
using System.Collections.Generic;

using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace lcmyjobs.Web.enprise
{
    public partial class ReceiveUserInfo : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Application["webname"] != null)
                {
                    this.Title = string.Format("单位管理中心—简历搜索：人才订阅  {0}", Application["webname"].ToString());
                }
                if (Session["enterprise_bid"] != null && Session["enterprise_name"] != null)
                {
                    this.lbl_title.Text = " " + Session["enterprise_name"].ToString();

                    Bind(Convert.ToInt32(Session["enterprise_bid"]));
                }
                else
                {
                    Maticsoft.Common.MessageBox.ShowAndRedirect(this, "请先登陆！", "EnterpriseLogin.html");
                }
            }
        }

        private void Bind(int bid)
        {
            lcmyjobs.Model.enterprise_basic eb = new lcmyjobs.BLL.enterprise_basic().GetModel(bid);

            if (eb != null)
            {
                if (eb.issubsrciption.Value)
                {
                    this.rbo_true.Checked = true;
                }
                else
                {
                    this.rbo_false.Checked = true;
                }
            }
        }
        protected void btn_save_Click(object sender, EventArgs e)
        {
            int flag = 0;
            if (this.rbo_true.Checked)
            {
                flag = 1;
            }

            lcmyjobs.BLL.enterprise_basic eb = new BLL.enterprise_basic();

            if (Session["enterprise_bid"] != null)
            {
                if (eb.UpdateIDList("issubsrciption", Session["enterprise_bid"].ToString(), flag.ToString()))
                {
                    Maticsoft.Common.MessageBox.Show(this, "保存成功！");
                    Bind(Convert.ToInt32(Session["enterprise_bid"]));
                }
            }

        }
    }
}